# -*- coding:utf-8 -*-
from django import forms
from django.contrib.auth.models import User

class UserForm(forms.Form):
	class Meta:
		model = User
		fields = ('username', 'password')

	username = forms.CharField(
		label='',
		error_messages={'required': '用户名不能为空', 'invalid': '用户名格式错误'},
		widget=forms.TextInput(
			attrs={
				'class': 'username',
				'placeholder': u'请输入正确的用户名',
			}
		)
	)
	password = forms.CharField(
		label='',
		error_messages={'required': '密码不能为空'},
		widget=forms.PasswordInput(
			attrs={
				'class': 'password',
				'placeholder': u'请输入正确的密码',
			}
		)
	)